//
//  CircleScoreViewController.m
//  wuliangye
//
//  Created by yeeyuntech on 2017/4/8.
//  Copyright © 2017年 jarze. All rights reserved.
//

#import "CircleScoreViewController.h"
#import "CircleScoreView.h"
#define RGB(r,g,b) [UIColor colorWithRed:r/255.0 green:g/255.0 blue:b/255.0 alpha:1.0]

@interface CircleScoreViewController ()
@property (nonatomic, strong) CircleScoreView *scoreView;
@end

@implementation CircleScoreViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor whiteColor];
    [self initView];
    // Do any additional setup after loading the view.
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

- (void)initView {

    self.scoreView.rangeValues = @[ @50,@90,@130,@240.0,@300];
    self.scoreView.rangeColors = @[ RGB(232, 111, 33),    RGB(232, 231, 33),  RGB(27, 202, 33),   RGB(231, 32, 43),    RGB(231, 150, 43) ];
    self.scoreView.rangeLabels = @[ @"VERY LOW",          @"LOW",             @"OK",              @"OVER FILL" ,@"PERFECT"];
}

- (CircleScoreView *)scoreView{
    if (_scoreView == nil) {
        _scoreView = [[CircleScoreView alloc] initWithFrame:CGRectMake(50, 100, 200, 200)];
        [self.view addSubview:_scoreView];
    }
    return  _scoreView;
}
@end
